package cn.tedu.oopextends;/**
 * @Author 金帮嘉诚 @Date 2021-06-25 星期五 18:57
 */
/*本类用于测试异常报错的原因和解决方法*/

/**知识点
 *
 *
 *
 * */
public class TestA {
    public static void main(String[] args) {
        Son son = new Son();
//        System.out.println(son.name);
        son.getName();
    }
}
class Father{
    private String name;
    int age;

    public Father() {
    }

    public Father(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
class Son extends Father{
    String name_son;
    int age;

    public Son() {
    }

    public Son(String name_son, int age) {
        this.name_son = name_son;
        this.age = age;
    }

    public String getName_son() {
        return name_son;
    }

    public void setName_son(String name_son) {
        this.name_son = name_son;
    }

    @Override
    public int getAge() {
        return age;
    }

    @Override
    public void setAge(int age) {
        this.age = age;
    }
}